package com.jiaanpei.frameproject.manage;

import android.app.Activity;
import android.content.Intent;
import android.util.Log;

import com.jiaanpei.frameproject.app.Constants;
import com.jiaanpei.frameproject.modle.login.LoginActivity;
import com.jiaanpei.frameproject.utils.SpUtil;
import com.umeng.message.PushAgent;
import com.umeng.message.UTrack;

public class Navigate {
    public static void startLoginActivity(Activity context) {
        if(context!=null){
            PushAgent mPushAgent = PushAgent.getInstance(context);
            mPushAgent.onAppStart();
            mPushAgent.deleteAlias(SpUtil.getString(context, Constants.USERID, ""),Constants.ALIAS,  new UTrack.ICallBack() {
                @Override
                public void onMessage(boolean isSuccess, String message) {
                    Log.i("isSuccessdelete",isSuccess+message);
                }
            });
            UserManager.clearUser(context);
            Intent intent = new Intent(context, LoginActivity.class);
            context.startActivity(intent);
            ActivityManager.getInstance().exitApp(context);
        }

    }
}
